$(function(){
	var nowuserid = window.location.search;
	var jqnum = nowuserid.indexOf('=');
	var jqnums = nowuserid.substr(jqnum+1);
	$("#lqhindex").click(function(){
		location.href="index.html?userid="+jqnums;
	});
	$.post('pinluncontservlet',{"userid":jqnums},function(pinlun_data,status){
		console.log(pinlun_data[1].length);
		$.each(pinlun_data[1],function(index,pinlunthree){
			var p1= pinlunthree.UserId;
			var p2 = pinlunthree.Discont;
		
			$.each(pinlun_data[0],function(one_index,pinlunone){
						if(pinlunthree.Wid==pinlunone.Wid){
							$.post('mesgservlet',{"mesguserid":pinlunthree.UserId},function(dis_data,status){
							$.each(dis_data,function(index,dis_mesg){
								$("#midcont").append($(".pinlundemo").eq(0).clone(true));
								$(".pinlundemo:eq(0)").css('display','none');
								$(".pinlundemo").last().css('display','block');
								$(".pinlundemo").last().find('.webocont p').html(pinlunone.Wcont);
								$(".pinlundemo").last().find('.webocont').siblings('p').html(pinlunthree.Discont);
								$(".pinlundemo").last().find('img').eq(0).attr('src',"images/"+dis_mesg.MesgHeadimg);
								$(".pinlundemo").last().find('.pinlunname').html(dis_mesg.MesgName);
								if($(".pinlundemo").last().find('.pinlunname').html()==pinlun_data[2].MesgName){
									console.log($(".pinlundemo").last().find('.pinlunname').html()+"==="+pinlun_data[2].MesgName)
									$(".pinlundemo").last().css('display','none');
								}
							});
						})
						
					}
				});
		});
	});
});